#pragma once
#include "hash_table.h"
namespace JRG {

	template<class K,class V,class Hash = HashFun<K>>
	class unorder_map
	{
		struct MapOfT {
			size_t operator()(const pair<K,V>& key)
			{
				return key.first;
			}
		};
	public:
		typedef typename HashTable<K, pair<const K, V>, MapOfT, Hash>::iterator iterator;
		typedef typename HashTable<K, pair<const K, V>, MapOfT, Hash>::const_iterator const_iterator;

		iterator begin()
		{
			return ht.begin();
		}
		iterator end()
		{
			return ht.end();
		}
		const_iterator begin() const
		{
			return ht.begin();
		}
		const_iterator end() const
		{
			return ht.end();
		}
		pair<iterator, bool>  insert(const pair<K,V>& data)
		{
			return ht.Insert(data);
		}
		bool erase(const K& data)
		{
			return ht.Erase(data);
		}
	private:
		HashTable<K,pair<const K,V> , MapOfT, Hash> ht;
	};
}